from PyQt5.QtWidgets import QStackedWidget, QLabel, QHBoxLayout, QFrame
from components import BaseInterface


class FolderFrame(QFrame):
    def __init__(self, parent=None):
        super().__init__(parent)


class FolderInterface(BaseInterface):
    def __init__(self, text: str, parent=None):
        super().__init__(text=text, parent=parent)
        self.stackWidget = QStackedWidget(self)
        self.layout = QHBoxLayout(self)
        self.folderLabel = QLabel(self.tr("文件管理"), self)
        self.__initWidget()

    def __initWidget(self):
        self.homeFrame = FolderFrame()
        self.stackWidget.addWidget(self.homeFrame)
        self.stackWidget.setCurrentIndex(0)
        self.__setQss()
        self.__initLayout()
        self.__connectSignalToSlot()

    def __initLayout(self):
        self.folderLabel.move(60, 63)
        self.layout.setContentsMargins(10, 70, 10, 10)
        self.layout.setSpacing(0)
        self.layout.addWidget(self.stackWidget)

    def __setQss(self):
        """ set style sheet """
        self.stackWidget.setObjectName('stackWidget')
        self.folderLabel.setObjectName('folderLabel')
        self.folderLabel.resize(200, 63)
        self.setStyleSheet("QLabel#folderLabel {"
                           "font: 33px 'Microsoft YaHei Light';"
                           "background-color: transparent;"
                           "color: black;"
                           "}")

    def __connectSignalToSlot(self):
        pass
